import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
import vuexPersist from 'vuex-persist'

export default new Vuex.Store({
  state: {
    user:{},
    title:[],
    content:{
      title:[],
      color:[],
      obj:{
        num1:[],
        num2:[]
      }
    }
        

        
    
  },
  mutations: {
    user(state,val){
      state.user=val
      console.log(state.user);
    },
    tit(state,val){
      state.content.title.push(val)
      
    },
    num(state,val){
      state.content.obj.num1.push(val.num1)
      state.content.obj.num2.push(val.num2)
    },
    color(state,val){
      state.content.color.push(val)
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [
    new vuexPersist({
      storage: window.localStorage
    }).plugin
  ]
})
